package com.example.ffmpeg;

import android.content.Context;
import android.opengl.GLSurfaceView;
import android.util.AttributeSet;
import android.view.SurfaceHolder;

/**
 * author  : Liushuai
 * time    : 2020/12/26 17:02
 * desc    :
 */
public class PlayView extends GLSurfaceView implements Runnable, SurfaceHolder.Callback {
    public PlayView(Context context) {
        super(context);
    }

    public PlayView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    public void run() {
          Open("/sdcard/经典.mp4",getHolder().getSurface());

    }

    @Override
    public void surfaceCreated(SurfaceHolder holder) {
        new Thread(this).start();
    }

    @Override
    public void surfaceDestroyed(SurfaceHolder holder) {
    }

    @Override
    public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {
    }

    public native void Open(String url, Object surface);

    public native void Open2(String url, Object surface);

}
